<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function getCookie(name){
        var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");

        if(arr=document.cookie.match(reg))

            return unescape(arr[2]);
        else
            return null;
    }
    var cookies = document.cookie;
    var sessionId = "";
    if(cookies.length>0){
        // var obj = cookies.split("=");
        sessionId = getCookie("3618_test_id");
    }
    if(sessionId!=null && sessionId!=undefined && sessionId!=""){
        localStorage.setItem("sessionId",sessionId);
        window.location.href = "index.html";
    }else{
        alert("检测到不匹配，可能是您的网络情况发生了变化，请尝试退出应用重新进入!");
    }

//    var cookies = document.cookie;
//    var sessionId = "";
//    if(cookies.length>0){
//        //获取session
//        var sessions = cookies.split(";");
//        if(sessions.length>0){
//            //获取sessionId
//            for(var i=0;i<sessions.length;i++){
//                var obj = sessions[i].split("=");
//                if(obj[0]==""){
//                    sessionId = obj[1];
//                }
//            }
//        }
//    }
//    if(sessionId){
//        localStorage.setItem("sessionId",sessionId);
//        window.location.href = "index.html";
//    }else{
//        alert("未获取到用户信息!");
//    }

</script>
</body>
</html>